<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 vector-feature-night-mode-enabled skin-theme-clientpref-os vector-sticky-header-enabled" lang="fr" dir="ltr"><head>
<meta charset="UTF-8">
<title>Rhino (moteur JavaScript)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./_res_/favicon.png">
<link rel="canonical" href="https://fr.wikipedia.org/wiki/Rhino_(moteur_JavaScript)"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
<link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
<link rel="stylesheet" type="text/css" href="./_res_/footer.css">
<link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Rhino_moteur_JavaScript rootpage-Rhino_moteur_JavaScript skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Rhino (moteur JavaScript)</span></h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="contentSub">
<div id="mw-content-subtitle"></div>
</div>
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="fr" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="fr" dir="ltr">
<div class="infobox_v3 infobox infobox--frwiki noarchive" style="width:260px">
<div class="entete icon informatique" style="color: #000000;"><style data-mw-deduplicate="TemplateStyles:r228712691">
/* start https://fr.wikipedia.org/ */
.mw-parser-output .entete.informatique{background-image:url("./_mw_/Picto.nfo.png")}
/* end https://fr.wikipedia.org/ */
</style>
<div>Rhino</div>
</div>
<div class="images">
</div>
<p class="mw-empty-elt">
</p>
<table><caption style="color:#000000;">Informations</caption>
<tbody><tr>
<th scope="row"><a href="D%C3%A9veloppeur" title="Développeur">Développé par</a></th>
<td>
<span class="wd_p178"><a href="Mozilla_Foundation" title="Mozilla Foundation">Mozilla Foundation</a></span></td>
</tr>
<tr>
<th scope="row"> <a href="Version_d'un_logiciel" title="Version d'un logiciel">Première version</a>
</th>
<td>
<span class="wd_p571"><time>1997</time></span></td>
</tr>
<tr>
<th scope="row"> <a href="Version_d'un_logiciel" title="Version d'un logiciel">Dernière version</a>
</th>
<td>
1.7.15 (<time class="nowrap" datetime="2024-05-04" data-sort-value="2024-05-04">4 mai 2024</time>)</td>
</tr>
<tr>
<th scope="row"><a href="D%C3%A9p%C3%B4t_(informatique)" title="Dépôt (informatique)">Dépôt</a></th>
<td>
<a rel="nofollow" class="external free" href="https://github.com/mozilla/rhino">https://github.com/mozilla/rhino</a></td>
</tr>
<tr>
<th scope="row"> <a href="Langage_de_programmation" title="Langage de programmation">Écrit en</a>
</th>
<td>
JavaScript et Java</td>
</tr>
<tr>
<th scope="row"> Type
</th>
<td>
<span class="wd_p31"><a href="Moteur_JavaScript" title="Moteur JavaScript">Moteur JavaScript</a></span></td>
</tr>
<tr>
<th scope="row"><a href="Licence_de_logiciel" title="Licence de logiciel">Licence</a></th>
<td>
<span class="wd_p275"><a href="Mozilla_Public_License" title="Mozilla Public License">MPL-2.0</a></span></td>
</tr>
<tr>
<th scope="row"><a href="Site_web" title="Site web">Site web</a></th>
<td>
<span class="wd_p856"><a rel="nofollow" class="external text" href="https://mozilla.github.io/rhino/">mozilla.github.io/rhino</a></span></td>
</tr>
</tbody></table>
<p class="mw-empty-elt">
</p>
</div>
<p><b>Rhino</b> est un <a href="Moteur_JavaScript" title="Moteur JavaScript">moteur</a> <a href="JavaScript" title="JavaScript">JavaScript</a> <a href="Logiciel_libre" title="Logiciel libre">libre</a>. Il est développé entièrement en <a href="Java_(langage)" title="Java (langage)">Java</a> par la <a href="Fondation_Mozilla" class="mw-redirect" title="Fondation Mozilla">Fondation Mozilla</a> (qui fournit aussi <a href="SpiderMonkey" title="SpiderMonkey">SpiderMonkey</a>, un moteur <a href="JavaScript" title="JavaScript">JavaScript</a> écrit en <a href="Langage_C" class="mw-redirect" title="Langage C">C</a>).
</p><p>Il est distribué selon les termes des licences <a href="Mozilla_Public_License" title="Mozilla Public License">MPL</a> et <a href="GNU_GPL" class="mw-redirect" title="GNU GPL">GNU GPL</a>.
</p><p><a href="Netscape_Communications_Corporation" class="mw-redirect" title="Netscape Communications Corporation">Netscape</a> a commencé le projet Rhino en 1997 au début du développement de Javagator, un navigateur en <a href="Java_(langage)" title="Java (langage)">Java</a> destiné à supplanter leur navigateur déjà existant, <a href="Netscape_Navigator" title="Netscape Navigator">Netscape Navigator</a>. Javagator fut abandonné, mais Rhino survécut, et fut même licencié par de multiples entreprises, qui en financèrent le développement. La Fondation Mozilla a hérité de Rhino en 1998, et l'a rendu open source par la suite.
</p>
<div class="mw-heading mw-heading2"><h2 id="Description_technique">Description technique</h2></div>
<p>Rhino peut être utilisé seul, comme interpréteur, mais aussi intégré dans une application. De même, il est capable de fonctionner en mode interprété, tout comme en mode compilé.
</p>
<div class="mw-heading mw-heading3"><h3 id="Objets_exposés_par_Rhino"><span id="Objets_expos.C3.A9s_par_Rhino"></span>Objets exposés par Rhino</h3></div>
<p>Rhino ne fournit en principe que les objets natifs définis par la spécification du langage (exemples : <code>String</code>, <code>Date</code>, etc.). On n'y trouvera donc pas les objets habituellement exposés par les moteurs JavaScript des différents navigateurs (exemples : <code>window</code>, <code>document</code>, etc.).
</p><p>Toutefois, son implémentation Java permet à un utilisateur d'utiliser tous les objets Java disponibles, comme le montre le code suivant (extrait de l'aide Mozilla<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>) :
</p>
<pre> <b>js></b> f = new java.io.File("test.txt")
<i>test.txt</i>
</pre>
<p>De plus, son utilisation en mode <a href="Shell_(informatique)" class="mw-redirect" title="Shell (informatique)">shell</a> expose un certain nombre de fonctionnalités supplémentaires, que l'on peut trouver sur le site de Mozilla<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.
</p><p>Chacune des applications embarquant Rhino peut exposer ses propres fonctionnalités. Par exemple, en tant que navigateur web, Javagator aurait exposé un <a href="Document_Object_Model" title="Document Object Model">DOM</a> HTML complet à Rhino, permettant la manipulation de l'environnement HTML via JavaScript.
</p><p>Enfin, la version 6 de l'<a href="Interface_de_programmation" title="Interface de programmation">API</a> <a href="Java_(technologie)" class="mw-redirect" title="Java (technologie)">Java</a> offre désormais une interface générique permettant d'implémenter n'importe quel moteur de script, et inclut Rhino par défaut<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>. Rhino est par la suite remplacé par <a href="Nashorn_(moteur_JavaScript)" title="Nashorn (moteur JavaScript)">Nashorn</a>, à partir de Java SE 8.
</p>
<div class="mw-heading mw-heading3"><h3 id="Mode_compilé_et_mode_interprété"><span id="Mode_compil.C3.A9_et_mode_interpr.C3.A9t.C3.A9"></span>Mode compilé et mode interprété</h3></div>
<p>Rhino est capable de fonctionner en mode <i>compilé</i> (le script est alors compilé en <a href="Bytecode_Java" title="Bytecode Java">bytecode Java</a>, Rhino pouvant même générer des binaires <code>.class</code> et les associer à des packages), et en mode <i>interprété</i> (le script est alors compilé en objets JavaScript).
</p><p>En mode <i>compilé</i>, Rhino peut rivaliser en performances avec <a href="SpiderMonkey" title="SpiderMonkey">SpiderMonkey</a>, son équivalent implémenté en C, mais il serait toutefois victime de <a href="Fuite_de_m%C3%A9moire" title="Fuite de mémoire">fuites de mémoire</a><sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>. En mode interprété, la compilation du script est plus rapide, et aucune fuite de mémoire n'a lieu, mais le script est alors plus lent.
</p>
<div class="mw-heading mw-heading2"><h2 id="Anecdotes">Anecdotes</h2></div>
<ul><li>L'animal de la couverture du livre <i><span class="lang-en" lang="en">JavaScript: The Definitive Guide</span></i> de <a href="O'Reilly_Media" title="O'Reilly Media">O'Reilly Media</a><sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> a inspiré le nom Rhino.</li>
<li>Le lien Java/JavaScript devient évident avec Rhino : le nom JavaScript avait été choisi pour des raisons de marketing, Netscape et <a href="Sun_Microsystems" title="Sun Microsystems">Sun Microsystems</a> ayant beaucoup collaboré à cette époque<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>. Ensuite, Rhino devait devenir le moteur JavaScript dans le nouveau Javagator, le navigateur Java de Netscape. Après l'annulation de Javagator, Sun Microsystems a été l'une des compagnies ayant licencié Rhino, et c'est enfin Rhino qui a été inclus comme <a href="Langage_de_script" title="Langage de script">langage de script</a> par défaut dans Java 6.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Notes_et_références"><span id="Notes_et_r.C3.A9f.C3.A9rences"></span>Notes et références</h2></div>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a> </span><span class="reference-text"><span class="ouvrage"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> <span class="noarchive">« <a rel="nofollow" class="external text" href="https://www.mozilla.org/rhino/ScriptingJava.html"><cite style="font-style:normal; color:var(--color-link-red, #d73333);" lang="en"><i>Scripting Java</i></cite></a> »<sup class="">(<a rel="nofollow" class="external text" href="https://web.archive.org/web/*/https://www.mozilla.org/rhino/ScriptingJava.html">Archive.org</a> • <a rel="nofollow" class="external text" href="https://archive.wikiwix.com/cache/?url=https://www.mozilla.org/rhino/ScriptingJava.html">Wikiwix</a> • <a rel="nofollow" class="external text" href="https://archive.is/https://www.mozilla.org/rhino/ScriptingJava.html">Archive.is</a> • <a rel="nofollow" class="external text" href="https://webcache.googleusercontent.com/search?hl=fr&q=cache:https://www.mozilla.org/rhino/ScriptingJava.html">Google</a> • Que faire ?)</sup></span>, sur <span class="italique">mozilla.org</span></span>.</span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a> </span><span class="reference-text"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> <a rel="nofollow" class="external text" href="https://www.mozilla.org/rhino/shell.html">JavaScript Shell</a>.</span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><a href="#cite_ref-3">↑</a> </span><span class="reference-text"><span class="ouvrage" id="O'Conner"><span class="ouvrage" id="John_O'Conner"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> John O'Conner, <span class="noarchive">« <a rel="nofollow" class="external text" href="http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/"><cite style="font-style:normal; color:var(--color-link-red, #d73333);" lang="en"><i><span class="lang-en" lang="en">Scripting for the Java Platform</span></i></cite></a> »<sup class="">(<a rel="nofollow" class="external text" href="https://web.archive.org/web/*/http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/">Archive.org</a> • <a rel="nofollow" class="external text" href="https://archive.wikiwix.com/cache/?url=http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/">Wikiwix</a> • <a rel="nofollow" class="external text" href="https://archive.is/http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/">Archive.is</a> • <a rel="nofollow" class="external text" href="https://webcache.googleusercontent.com/search?hl=fr&q=cache:http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/">Google</a> • Que faire ?)</sup></span>, sur <span class="italique">java.sun.com</span></span></span>.</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><a href="#cite_ref-4">↑</a> </span><span class="reference-text"><span class="ouvrage"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> « <a rel="nofollow" class="external text" href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/History"><cite style="font-style:normal;" lang="en">Rhino History</cite></a> »</span>.</span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><a href="#cite_ref-5">↑</a> </span><span class="reference-text"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> <a rel="nofollow" class="external text" href="http://www.oreilly.com/catalog/jscript3/">Livre <i><span class="lang-en" lang="en">JavaScript: The Definitive Guide, 3rd Edition</span></i></a>, <span class="lang-en" lang="en">O'Reilly Media</span>.</span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><a href="#cite_ref-6">↑</a> </span><span class="reference-text"><span class="ouvrage"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> « <a rel="nofollow" class="external text" href="http://www6.uniovi.es/java-http/pr951204-03.html"><cite style="font-style:normal;" lang="en"><i>Netscape and Sun announce JavaScript, the Open, Cross-Platform Object Scripting Language for Enterprise Networks and the Internet</i></cite></a> », sur <span class="italique">netscape.com</span></span>.</span>
</li>
</ol></div>
<div class="mw-heading mw-heading2"><h2 id="Voir_aussi">Voir aussi</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Liens_externes">Liens externes</h3></div>
<ul><li><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> <a rel="nofollow" class="external text" href="https://www.mozilla.org/rhino/">Rhino sur le site Fondation Mozilla</a></li></ul>
<div class="navbox-container" style="clear:both;">
</div>
<ul id="bandeau-portail" class="bandeau-portail"><li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail de l’informatique</span> </span></li> <li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail des logiciels libres</span> </span></li> </ul></div><!--htdig_noindex--><div><div class="zim-footer">
Cet article est issu de <a class="external text" title="Dernière modification le 2025-09-05" href="https://fr.wikipedia.org/wiki/?title=Rhino_(moteur_JavaScript)&oldid=228742103">Wikipédia</a>. Sauf mention contraire, le texte est disponible sous <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.fr">Creative Commons Attribution-Share Alike 4.0</a>. Des conditions supplémentaires peuvent s’appliquer aux fichiers multimédias.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
<script src="./_webp_/webpHandler.js"></script>
</body></html>